<!-- <form class="layui-form x-center" action="" style="width:100%">
    <div class="layui-form-pane" style="margin-top: 5px;">
        <div class="layui-form-item">
            <div class="layui-input-inline">
                <select name="cname">
                        <option value="">请选择角色</option>
                        <option value="评论相关">评论相关</option>
                        <option value="评论相关">评论相关</option>
                        <option value="会员相关">会员相关</option>
                    </select>
            </div>
            <div class="layui-input-inline">
                <input type="text" name="rules" placeholder="模块/控制器/方法" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-input-inline">
                <input type="text" name="name" placeholder="权限名称" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-input-inline" style="width:80px">
                <button class="layui-btn" lay-submit="" lay-filter="*">
                        <i class="layui-icon">&#xe608;</i>添加</button>
            </div>
        </div>
    </div>
</form> -->
<div id="AdminUseronlineDt" lay-filter="AdminUseronlineDt"></div>
<script>
    table.render({
        elem: '#AdminUseronlineDt',
        height: 'full-130',
        skin: 'row',
        even: true,
        size: 'sm',
        url: '__APP__/Admin/Useronline/view',
        where: { sort: 'id', order: 'desc' },
        limit: 5,
        limits: [1, 2, 3, 5, 10, 20],
        method: 'post',
        response: {
            statusName: 'status',
            statusCode: 1,
            msgName: 'msg',
            countName: 'total',
            dataName: 'rows'
        },
        done: function(res, curr, count) {
            //如果是异步请求数据方式，res即为你接口返回的信息。
            //如果是直接赋值的方式，res即为：{data: [], count: 99} data为当前页数据、count为数据总长度
            //console.log(res);
            //得到当前页码
            //console.log(curr);
            //得到数据总量
            //console.log(count);
        },
        page: true,
        cols: [
            [
                { field: 'id', title: 'ID', width: 80, checkbox: true, fixed: true },
                { field: 'account', width: 200, title: '账户' },
                {
                    field: 'roles',
                    width: 200,
                    title: '所属角色',
                    templet: function(data) {
                        //console.log(data);
                        if (data.roles.length != 0) {
                            return '<span style="color:black;">' + data.roles[0].title + '</span>'
                        } else {
                            return '空';
                        }
                    }
                },
                { field: 'update_time', title: '最后操作时间', minWidth: 150 },
                { field: 'last_login_ip', title: '最后登录IP', minWidth: 180 },
                { field: 'email', width: 200, title: '邮件' },
                {
                    field: 'status',
                    width: 100,
                    title: '状态',
                    align: 'center'
                }
            ]
        ]
    });
</script>